{extend name="public:base" /}
{block name='header'}
{/block}
{block name='main'}
<div class="ShareAnyContainer" style="font-size: 14px;">
    当前位置：<a href="{:url('/')}" title="首页">首页</a>&nbsp;&nbsp;/&nbsp;&nbsp;<a
        href="{:url('/shop/artwork/cart/')}" title="购物车">购物车</a>
</div>
<div class="ShareAnySeparate"></div>
<div class="ShareAnyContainer">
    <div class="work_parent">
        <div class="live">
            {volist name="$datalist" id="artwork"}
                <table>
                    <tr>
                        <td valign="top" style="width:300px;"><a
                                href="{:url('/')}shop/artwork/detail/id/{$artwork['id']}/"><img
                                src="/{$artwork['img'][0]}" style="width: 100%; display: block;"></a>
                        </td>
                        <td style="padding:10px;" valign="top">
                            <div style="text-align: center; font-size: 20px; font-weight: bold;">
                                {$artwork['title']}
                            </div>
                            <br>

                            <div>{$artwork['about']}</div>
                        </td>
                        <td style="font-size: 20px; padding:10px;">￥ {$artwork['price']}</td>
                        <td style="font-size: 20px; padding:10px; width:50px;"><a
                                href="javascript:;" onclick="delCart({$artwork.id})">删除</a></td>
                    </tr>
                </table>
            {/volist}
        </div>

    </div>

</div>
<div class="ShareAnySeparate"></div>
<div class="ShareAnyContainer" style="font-size: 20px; text-align: right;">
    总价：<b>{$count}</b>￥

</div>
<div class="ShareAnySeparate"></div>
<div class="ShareAnyContainer" style="text-align: right;">
    <a href="javascript:;"><img
            src="__MODULE_IMG__/buy.png"></a>

</div>
<script>

    function delCart(artworkid) {
        $.ajax({
            url: "/shop/artwork/delCart/",
            type: "POST",
            dataType: "JSON",
            data: {
                id: artworkid,
            },
            success: function (data) {
//                alert(data.message);
//                if (data.code == "1") {
                    window.location.reload();
//                }
            }
        });
    }
</script>
{/block}
{block name='footer'}
{/block}